import React, { FC } from 'react';
import yunshi from '../../assets/img/yunshi.png';
import shangjia from '../../assets/img/shangjia.png';
import yonghu from '../../assets/img/yonghu.png';
import { Button } from 'antd-mobile';
import { withRouter, useHistory } from 'react-router-dom';
import './style.css'

// 初始页面(区分商家和用户)
const Main: FC = props => {
    const history = useHistory();
    return (
        <div className='main'>
            <div className='logo-title'>
                <img src={yunshi} className='logo' />
                <div className='title'>
                    <span className='yunshi'>云食</span>
                </div>
            </div>
            <div className='button'>
                <Button block size='large' onClick={()=>history.push("/merLogReg")}>
                   <img src={shangjia} className='img1' />
                   <span className='my'>我是商家</span>
                </Button>
                <Button block size='large' onClick={()=>history.push("/userLogReg")}>
                   <img src={yonghu} className='img2' />
                   <span className='my'>我是用户</span>
                </Button>
            </div>
        </div>
    )
}
export default withRouter(Main);
